<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>{$basicInfo.name}</title>
  <link rel="Shortcut Icon" href="{$basicInfo.favicon}">
  <link rel="Bookmark" href="{$basicInfo.favicon}">
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.7 -->
  <link rel="stylesheet" href="__STATIC__/bower_components/bootstrap/dist/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="__STATIC__/bower_components/font-awesome/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="__STATIC__/bower_components/Ionicons/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="__STATIC__/dist/css/AdminLTE.min.css">
  <!-- iCheck -->
  <link rel="stylesheet" href="__STATIC__/plugins/iCheck/square/blue.css">
  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
  <!-- Google Font -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="hold-transition login-page" style="background-image: url(https://cdn.qiduo.net/console/login.jpg); background-repeat: no-repeat; background-position: center; background-size: cover;">
<div class="login-box" style="height: 295px;position: absolute;top: 0;left: 0;right: 0;bottom: 0;margin: auto;">
  <div class="login-logo">
    <a href="" style="color:#fff;"><b>Gee Control Panel<b></a>
  </div>
  <div class="login-box-body">
    <p class="login-box-msg">请输入您的用户名和密码进行登录</p>

    <form id="log" action="{:url('admin/Login/auth')}" method="post">
      <div class="form-group has-feedback">
        <input type="text" name="username" class="form-control" placeholder="用户名">
        <span class="glyphicon glyphicon-user form-control-feedback"></span>
      </div>
      <div class="form-group has-feedback">
        <input type="password" name="password" class="form-control" placeholder="密码">
        <span class="glyphicon glyphicon-lock form-control-feedback"></span>
      </div>
      <div class="row">
        <div class="col-xs-8">
          <!-- <div class="checkbox icheck">
            <label>
              <input type="checkbox"> 记住我
            </label>
          </div> -->
        </div>
        <div class="col-xs-4">
          <button type="button" class="btn btn-primary btn-block btn-flat sub">登录</button>
        </div>
      </div>
    </form>
  </div>
</div>
<div class="footer" style="position: absolute;bottom: 0;left: 0;right: 0;margin: auto;color: #fff;text-align: center;height: 140px;line-height: 140px;">
  Powered By GeeCP V1.0.1 
</div>

<!-- jQuery 3 -->
<script src="__STATIC__/bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="__STATIC__/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- iCheck -->
<script src="__STATIC__/plugins/iCheck/icheck.min.js"></script>
<!-- axios 0.18.0 -->
<script src="__STATIC__/bower_components/axios/axios.min.js"></script>
<!-- js-cookie 0.18.0 -->
<script src="__STATIC__/bower_components/cookie/js.cookie.min.js"></script>
<!-- axios BasicConfig -->
<script src="__STATIC__/dist/js/axiosConfig.js"></script>
<script>
  $(function () {
    $('input').iCheck({
      checkboxClass: 'icheckbox_square-blue',
      radioClass: 'iradio_square-blue',
      increaseArea: '20%' /* optional */
    });

    $('.sub').click(function(){
      $.ajax({
        url: "{:url('admin/Login/auth')}",
        type: 'post',
        data: {
          username: $('[name="username"]').val(),
          password: $('[name="password"]').val(),
        },
        success: function(e){
          if(e.status == 200){
            Cookies.set('token',e.token,{expires: 1/12,path: '/'});
            location.reload();
          } else {
            alert(e.msg);
          }
        },
        error: function(e){

        }
      });
    });
  });
</script>
</body>
</html>
